The present disclosure relates to alignment of a sensor component, such as a transmitter, within a sensor housing. In certain conventional sensors of type having adjustable emitters, the emitters have barrels disposed in matching sockets, allowing the direction in which the emitters are pointed to be varied. The barrel of the emitter is typically held in place by screws balanced by springs only. Glue is used to maintain the alignment after the alignment adjustment is done. However, it has been observed that the alignment can undergo significant drift as the ambient temperature changes. It is thus desirable to device a sensor assembly and method to allow convenient adjustment of the emitter, or another adjustable component while maintaining the stability of the sensor.